import {useState} from 'react'
import {useDidShow} from '@tarojs/taro'
import {View} from '@tarojs/components'
import {AtTabs, AtTabsPane} from 'taro-ui'
import http from '../../../http/http'
import TipList from './tipList'


const ContentBar = ({allGoods, allGoodsData}) => {

  const [currentContent, setcurrentContent] = useState(0)
  const [classify2, setClassify2] = useState([
    {title: '综合'},
    {title: '价格'},
    {title: '销量'}
  ])


  // 切换二级分类栏
  const handleClick = (value) => {
    setcurrentContent(value)
  }



  return (
    <View className='contentBar'>
      <AtTabs current={currentContent} tabList={classify2} onClick={handleClick}>

        {classify2.map((v, i) => (<AtTabsPane current={currentContent} index={i} key={v} >
          <View>
            <TipList allGoods={allGoods} allGoodsData={allGoodsData}></TipList>
          </View>
        </AtTabsPane>))}

      </AtTabs>
    </View>
  )
}

export default ContentBar